﻿<Application x:Class="Project.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:CustomControls="clr-namespace:CustomControls;assembly=CustomControls"
             xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
             xmlns:vsm ="clr-namespace:System.Windows;assembly=PresentationFramework"
             xmlns:Controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
             StartupUri="MainWindow.xaml">
    <Application.Resources>
        <!---Brushes-->
        <SolidColorBrush x:Key="DisabledBackgroundBrush" Color="#EEE" />
        <SolidColorBrush x:Key="SolidBorderBrush" Color="#69810E" />
        <SolidColorBrush x:Key="WindowBackgroundBrush" Color="#FFF" />
        <SolidColorBrush x:Key="GlyphBrush" Color="#FFF" />
        <SolidColorBrush x:Key="NormalBrush" Color="#5C710D" />
        <SolidColorBrush x:Key="DisabledForegroundBrush" Color="white" />
        <Style x:Key="{x:Static MenuItem.SeparatorStyleKey}"
       TargetType="Separator">
            <Setter Property="Height" Value="1"/>
            <Setter Property="Margin" Value="0,4,0,4"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Separator">
                        <Border BorderBrush="{StaticResource SolidBorderBrush}"
                BorderThickness="1"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        
        <!-- Custom Datepicker-->
        <!--The template for the button that displays the calendar.-->
        <Style x:Key="DropDownButtonStyle"
       TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Grid>
                            <vsm:VisualStateManager.VisualStateGroups>
                                <vsm:VisualStateGroup x:Name="CommonStates">
                                    <vsm:VisualStateGroup.Transitions>
                                        <vsm:VisualTransition GeneratedDuration="0" />
                                        <vsm:VisualTransition GeneratedDuration="0:0:0.1"
                                  To="MouseOver" />
                                        <vsm:VisualTransition GeneratedDuration="0:0:0.1"
                                  To="Pressed" />
                                        </vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualState x:Name="Normal" />
                                    <vsm:VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <ColorAnimationUsingKeyFrames BeginTime="0"
                                                Duration="00:00:00.001"
                                                Storyboard.TargetName="BackgroundGradient"
                                                Storyboard.TargetProperty="(Border.Background).
                    (GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                <SplineColorKeyFrame KeyTime="0"
                                         Value="#F2FFFFFF" />
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="0"
                                                Duration="00:00:00.001"
                                                Storyboard.TargetName="BackgroundGradient"
                                                Storyboard.TargetProperty="(Border.Background).
                    (GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                <SplineColorKeyFrame KeyTime="0"
                                         Value="#CCFFFFFF" />
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimation Duration="0"
                                  To="#FF448DCA"
                                  Storyboard.TargetProperty="(Border.Background).
                            (SolidColorBrush.Color)"
                                  Storyboard.TargetName="Background" />
                                            <ColorAnimationUsingKeyFrames BeginTime="0"
                                                Duration="00:00:00.001"
                                                Storyboard.TargetName="BackgroundGradient"
                                                Storyboard.TargetProperty="(Border.Background).
                    (GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                <SplineColorKeyFrame KeyTime="0"
                                         Value="#7FFFFFFF" />
                                            </ColorAnimationUsingKeyFrames>
                                        </Storyboard>
                                        </vsm:VisualState>
                                    <vsm:VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ColorAnimationUsingKeyFrames BeginTime="0"
                                                Duration="00:00:00.001"
                                                Storyboard.TargetName="Background"
                                                Storyboard.TargetProperty="(Border.Background).
                      (SolidColorBrush.Color)">
                                                <SplineColorKeyFrame KeyTime="0"
                                         Value="white" />
                                            </ColorAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="0"
                                                 Duration="00:00:00.001"
                                                 Storyboard.TargetProperty="(UIElement.Opacity)"
                                                 Storyboard.TargetName="Highlight">
                                                <SplineDoubleKeyFrame KeyTime="0"
                                          Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="0"
                                                Duration="00:00:00.001"
                                                Storyboard.TargetName="BackgroundGradient"
                                                Storyboard.TargetProperty="(Border.Background).
                    (GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                <SplineColorKeyFrame KeyTime="0"
                                         Value="#F4FFFFFF" />
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="0"
                                                Duration="00:00:00.001"
                                                Storyboard.TargetName="BackgroundGradient"
                                                Storyboard.TargetProperty="(Border.Background).
                    (GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                <SplineColorKeyFrame KeyTime="0"
                                         Value="#EAFFFFFF" />
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="0"
                                                Duration="00:00:00.001"
                                                Storyboard.TargetName="BackgroundGradient"
                                                Storyboard.TargetProperty="(Border.Background).
                    (GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                <SplineColorKeyFrame KeyTime="0"
                                         Value="#C6FFFFFF" />
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="0"
                                                Duration="00:00:00.001"
                                                Storyboard.TargetName="BackgroundGradient"
                                                Storyboard.TargetProperty="(Border.Background).
                    (GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                <SplineColorKeyFrame KeyTime="0"
                                         Value="#6BFFFFFF" />
                                            </ColorAnimationUsingKeyFrames>
                                        </Storyboard>
                                        </vsm:VisualState>
                                    <vsm:VisualState x:Name="Disabled" />
                                    </vsm:VisualStateGroup>
                                </vsm:VisualStateManager.VisualStateGroups>
                            <Grid Background="#11FFFFFF"
                FlowDirection="LeftToRight"
                HorizontalAlignment="Center"
                Height="18"
                Margin="0"
                VerticalAlignment="Center"
                Width="19">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="20*" />
                                    <ColumnDefinition Width="20*" />
                                    <ColumnDefinition Width="20*" />
                                    <ColumnDefinition Width="20*" />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="23*" />
                                    <RowDefinition Height="19*" />
                                    <RowDefinition Height="19*" />
                                    <RowDefinition Height="19*" />
                                </Grid.RowDefinitions>
                                <Border x:Name="Highlight"
                    BorderThickness="1"
                    Grid.ColumnSpan="4"
                    CornerRadius="0,0,1,1"
                    Margin="-1"
                    Opacity="1"
                    Grid.Row="0"
                    Grid.RowSpan="4">
                                    <Border.BorderBrush>
                                        <SolidColorBrush Color="{DynamicResource ControlPressedColor}" />
                                    </Border.BorderBrush>
                                </Border>
                                <Border x:Name="Background"
                    BorderBrush="#FFFFFFFF"
                    BorderThickness="1"
                    Grid.ColumnSpan="4"
                    CornerRadius=".5"
                    Margin="0,-1,0,0"
                    Opacity="1"
                    Grid.Row="1"
                    Grid.RowSpan="3">
                                    <Border.Background>
                                        <SolidColorBrush Color="{DynamicResource ControlDarkColor}" />
                                    </Border.Background>
                                </Border>
                                <Border x:Name="BackgroundGradient"
                    BorderBrush="#BF000000"
                    BorderThickness="1"
                    Grid.ColumnSpan="4"
                    CornerRadius=".5"
                    Margin="0,-1,0,0"
                    Opacity="1"
                    Grid.Row="1"
                    Grid.RowSpan="3">
                                    <Border.Background>
                                        <LinearGradientBrush EndPoint=".7,1"
                                     StartPoint=".7,0">
                                            <GradientStop Color="#FFFFFFFF"
                                Offset="0" />
                                            <GradientStop Color="#F9FFFFFF"
                                Offset="0.375" />
                                            <GradientStop Color="#E5FFFFFF"
                                Offset="0.625" />
                                            <GradientStop Color="#C6FFFFFF"
                                Offset="1" />
                                        </LinearGradientBrush>
                                    </Border.Background>
                                </Border>
                                <Rectangle Grid.ColumnSpan="4"
                       Grid.RowSpan="1"
                       StrokeThickness="1">
                                    <Rectangle.Fill>
                                        <LinearGradientBrush EndPoint="0,1"
                                     StartPoint="0,0">
                                            <GradientStop Color="{DynamicResource HeaderTopColor}" />
                                            <GradientStop Color="{DynamicResource ControlMediumColor}"
                                Offset="1" />
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                    <Rectangle.Stroke>
                                        <LinearGradientBrush EndPoint="0.48,-1"
                                     StartPoint="0.48,1.25">
                                            <GradientStop Color="#FF494949" />
                                            <GradientStop Color="#FF9F9F9F"
                                Offset="1" />
                                        </LinearGradientBrush>
                                    </Rectangle.Stroke>
                                </Rectangle>
                                <Path Fill="#FF2F2F2F"
                  Grid.Row="1"
                  Grid.Column="0"
                  Grid.RowSpan="3"
                  Grid.ColumnSpan="4"
                  HorizontalAlignment="Center"
                  VerticalAlignment="Center"
                  RenderTransformOrigin="0.5,0.5"
                  Margin="4,3,4,3"
                  Stretch="Fill"
                  Data="M11.426758,8.4305077 L11.749023,8.4305077 
                    L11.749023,16.331387 L10.674805,16.331387 
                    L10.674805,10.299648 L9.0742188,11.298672
                    L9.0742188,10.294277 C9.4788408,10.090176 
                    9.9094238,9.8090878 10.365967,9.4510155 
                    C10.82251,9.0929432 11.176106,8.7527733 
                    11.426758,8.4305077 z M14.65086,8.4305077 
                    L18.566387,8.4305077 L18.566387,9.3435936 
                    L15.671368,9.3435936 L15.671368,11.255703 
                    C15.936341,11.058764 16.27293,10.960293 
                    16.681133,10.960293 C17.411602,10.960293 
                    17.969301,11.178717 18.354229,11.615566 
                    C18.739157,12.052416 18.931622,12.673672
                    18.931622,13.479336 C18.931622,15.452317 
                    18.052553,16.438808 16.294415,16.438808
                    C15.560365,16.438808 14.951641,16.234707 
                    14.468243,15.826504 L14.881817,14.929531
                    C15.368796,15.326992 15.837872,15.525723 
                    16.289043,15.525723 C17.298809,15.525723 
                    17.803692,14.895514 17.803692,13.635098 
                    C17.803692,12.460618 17.305971,11.873379 
                    16.310528,11.873379 C15.83071,11.873379 
                    15.399232,12.079271 15.016094,12.491055
                    L14.65086,12.238613 z" />
                                <Ellipse Grid.ColumnSpan="4"
                     Fill="#FFFFFFFF"
                     HorizontalAlignment="Center"
                     Height="3"
                     StrokeThickness="0"
                     VerticalAlignment="Center"
                     Width="3" />
                                <Border x:Name="DisabledVisual"
                    BorderBrush="#B2FFFFFF"
                    BorderThickness="1"
                    Grid.ColumnSpan="4"
                    CornerRadius="0,0,.5,.5"
                    Opacity="0"
                    Grid.Row="0"
                    Grid.RowSpan="4" />
                            </Grid>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style TargetType="{x:Type DatePicker}">
            <Setter Property="Foreground"
          Value="black" />
            <Setter Property="IsTodayHighlighted"
          Value="True" />
            <Setter Property="SelectedDateFormat"
          Value="Short" />
            <Setter Property="Padding"
          Value="2" />
            <Setter Property="BorderThickness"
          Value="1,2,1,2" />
            <Setter Property="BorderBrush" Value="#BABABA" />
            <Setter Property="HorizontalContentAlignment"
          Value="Stretch" />
            <Setter Property="Validation.ErrorTemplate">
                <Setter.Value>
                    <ControlTemplate>
                        <Grid>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="BorderBrush" Value="#8F8F8F"/>
                </Trigger>
                <Trigger Property="IsDropDownOpen" Value="True">
                    <Setter Property="BorderBrush" Value="#5C5C5C"/>
                </Trigger>
                <Trigger Property="Validation.HasError" Value="True">
                    <Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)[0].ErrorContent}" />
                    <Setter Property="BorderBrush" Value="Red" />
                </Trigger>
            </Style.Triggers>
        </Style>

        <!-- Custom ValidDatePicker-->
        <Style TargetType="{x:Type CustomControls:ValidDatePicker}" BasedOn="{StaticResource {x:Type DatePicker}}">
        </Style>

        <!-- Custom RadioButton -->
        <Style x:Key="RadioButtonFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Border>
                            <Rectangle 
            Margin="15,0,0,0"
            StrokeThickness="1"
            Stroke="#60000000"
            StrokeDashArray="1 2"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="{x:Type RadioButton}" TargetType="{x:Type RadioButton}">
            <Setter Property="SnapsToDevicePixels" Value="true"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="FocusVisualStyle"    Value="{StaticResource RadioButtonFocusVisual}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type RadioButton}">
                        <BulletDecorator Background="Transparent">
                            <BulletDecorator.Bullet>
                                <Grid Width="13" 
              Height="13" >
                                    <Ellipse x:Name="Border"  
                Fill="white"
                StrokeThickness="1"
                Stroke="#BABABA" />
                                    <Ellipse x:Name="CheckMark"
                Margin="4"
                Fill="#69810E" />
                                </Grid>
                            </BulletDecorator.Bullet>
                            <ContentPresenter 
            Margin="4,0,0,0"
            VerticalAlignment="Center"
            HorizontalAlignment="Left"
            RecognizesAccessKey="True"/>
                        </BulletDecorator>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsChecked" Value="false">
                                <Setter TargetName="CheckMark" Property="Visibility" Value="Collapsed"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter TargetName="Border" Property="Stroke" Value="#8F8F8F" />
                            </Trigger>
                            <Trigger Property="IsPressed" Value="true">
                                <Setter TargetName="Border" Property="Fill" Value="#69810E" />
                                <Setter TargetName="Border" Property="Stroke" Value="#5C5C5C" />
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter TargetName="Border" Property="Fill" Value="{StaticResource DisabledBackgroundBrush}" />
                                <Setter TargetName="Border" Property="Stroke" Value="#40000000" />
                                <Setter Property="Foreground" Value="#80000000"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!--Custom ChekBox-->
        <Style x:Key="CheckBoxFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Border>
                            <Rectangle 
            Margin="15,0,0,0"
            StrokeThickness="1"
            Stroke="#60000000"
            StrokeDashArray="1 2"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="{x:Type CheckBox}" TargetType="CheckBox">
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="SnapsToDevicePixels" Value="true"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="FocusVisualStyle"    Value="{StaticResource CheckBoxFocusVisual}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="CheckBox">
                        <BulletDecorator Background="Transparent">
                            <BulletDecorator.Bullet>
                                <Border x:Name="Border"  
              Width="13" 
              Height="13" 
              CornerRadius="0" 
              Background="white"
              BorderThickness="1"
              BorderBrush="#BABABA">
                                    <Path 
                Width="7" Height="7" 
                x:Name="CheckMark"
                SnapsToDevicePixels="False" 
                Stroke="#212121"
                StrokeThickness="2"
                Data="M 1 7 L 1 1 M 1 7 L 7 0" />
                                </Border>
                            </BulletDecorator.Bullet>
                            <ContentPresenter Margin="4,0,0,0"
            VerticalAlignment="Center"
            HorizontalAlignment="Left"
            RecognizesAccessKey="True"/>
                        </BulletDecorator>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsChecked" Value="false">
                                <Setter TargetName="CheckMark" Property="Visibility" Value="Collapsed"/>
                            </Trigger>
                            <Trigger Property="IsChecked" Value="{x:Null}">
                                <Setter TargetName="CheckMark" Property="Data" Value="M 0 7 L 7 0" />
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter TargetName="Border" Property="BorderBrush" Value="#8F8F8F" />
                            </Trigger>
                            <Trigger Property="IsPressed" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="#212121" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="#212121" />
                                <Setter TargetName="CheckMark" Property="Stroke" Value="white" />
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter TargetName="Border" Property="Background" Value="gray" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}" />
                                <Setter Property="Foreground" Value="gray"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!--Custom TextBox-->
        <Style x:Key="{x:Type TextBox}" TargetType="{x:Type TextBox}">
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="SnapsToDevicePixels" Value="True"/>
            <Setter Property="OverridesDefaultStyle" Value="True"/>
            <Setter Property="CharacterCasing" Value="Upper" />
            <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
            <Setter Property="MinWidth" Value="20"/>
            <Setter Property="MinHeight" Value="20"/>
            <Setter Property="AllowDrop" Value="true"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type TextBoxBase}">
                        <Border 
          Name="Border"
          CornerRadius="0" 
          Background="{StaticResource WindowBackgroundBrush}"
          BorderBrush="#BABABA"
          BorderThickness="1,2,1,2" >
                            <ScrollViewer Margin="0" x:Name="PART_ContentHost"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}"/>
                                <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}"/>
                                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="Border" Property="BorderBrush" Value="#8F8F8F"/>
                            </Trigger>
                            <Trigger Property="IsKeyboardFocused" Value="True">
                                <Setter TargetName="Border" Property="BorderBrush" Value="#5C5C5C"/>
                            </Trigger>
                            <Trigger Property="Validation.HasError" Value="True">
                                <Setter Property="ToolTip" 
                            Value="{Binding RelativeSource={x:Static RelativeSource.Self}, 
                            Path=(Validation.Errors)[0].ErrorContent}" />
                                <Setter TargetName="Border"  Property="BorderBrush" Value="Red" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!--Custom PasswordBox-->
        <Style x:Key="{x:Type PasswordBox}" TargetType="{x:Type PasswordBox}">
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="SnapsToDevicePixels" Value="True"/>
            <Setter Property="OverridesDefaultStyle" Value="True"/>
            <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
            <Setter Property="MinWidth" Value="20"/>
            <Setter Property="MinHeight" Value="20"/>
            <Setter Property="AllowDrop" Value="true"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type PasswordBox}">
                        <Border 
          Name="Border"
          CornerRadius="0" 
          Padding="2"
          Background="{StaticResource WindowBackgroundBrush}"
          BorderBrush="#BABABA"
          BorderThickness="1,2,1,2" >
                            <ScrollViewer Margin="0" x:Name="PART_ContentHost"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}"/>
                                <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}"/>
                                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="Border" Property="BorderBrush" Value="#8F8F8F"/>
                            </Trigger>
                            <Trigger Property="IsKeyboardFocused" Value="True">
                                <Setter TargetName="Border" Property="BorderBrush" Value="#5C5C5C"/>
                            </Trigger>
                            <Trigger Property="Validation.HasError" Value="True">
                                <Setter Property="ToolTip" 
                            Value="{Binding RelativeSource={x:Static RelativeSource.Self}, 
                            Path=(Validation.Errors)[0].ErrorContent}" />
                                <Setter TargetName="Border"  Property="BorderBrush" Value="Red" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- Custom AutoCompleteBox-->
        <Style TargetType="{x:Type Controls:AutoCompleteBox}">
            <Setter Property="TextBoxStyle" Value="{StaticResource {x:Type TextBox}}">
                </Setter>
       
        </Style>
        
        <!-- Custom MaskTextBox-->
        <DataTemplate x:Key="DefaultWatermarkTemplate">
            <ContentControl Content="{Binding}" Foreground="Gray" Focusable="False" />
        </DataTemplate>
        <Style TargetType="{x:Type CustomControls:MaskTextBox}">
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="Background" Value="White" />
            <Setter Property="BorderBrush" Value="#BABABA" />
            <Setter Property="CharacterCasing" Value="Upper" />
            <Setter Property="BorderThickness" Value="1,2,1,2" />
            <Setter Property="AllowDrop" Value="true" />
            <Setter Property="FocusVisualStyle" Value="{x:Null}" />
            <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
            <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
            <Setter Property="WatermarkTemplate" Value="{StaticResource DefaultWatermarkTemplate}" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type CustomControls:MaskTextBox}">
                        <Grid>

                            <Border x:Name="Border" BorderThickness="1,2,1,2" BorderBrush="#BABABA" CornerRadius="0" Background="White" />
                            <Border x:Name="MouseOverVisual" Opacity="0" BorderThickness="1,2,1,2" BorderBrush="#8F8F8F" CornerRadius="0" />
                            <Border x:Name="FocusVisual" Opacity="0" BorderThickness="1,2,1,2" BorderBrush="#5C5C5C" CornerRadius="0" />
                            <Border x:Name="HasErrors" Opacity="0" BorderThickness="1,2,1,2" BorderBrush="Red" CornerRadius="0" />
                            <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                            <ContentPresenter x:Name="PART_WatermarkHost"
                                    Content="{TemplateBinding Watermark}"
                                    ContentTemplate="{TemplateBinding WatermarkTemplate}"
                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    IsHitTestVisible="False"
                                    Margin="{TemplateBinding Padding}"
                                    Visibility="Collapsed" />

                        </Grid>
                        <ControlTemplate.Triggers>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsFocused" Value="False" />
                                    <Condition Property="Text" Value="" />
                                </MultiTrigger.Conditions>
                                <MultiTrigger.Setters>
                                    <Setter Property="Visibility" TargetName="PART_WatermarkHost" Value="Visible" />
                                </MultiTrigger.Setters>
                            </MultiTrigger>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="MouseOverVisual" Property="Opacity" Value="1" />
                            </Trigger>
                            <Trigger Property="IsFocused" Value="True">
                                <Setter TargetName="FocusVisual" Property="Opacity" Value="1" />
                            </Trigger>
                            <Trigger Property="Validation.HasError" Value="True">
                                <Setter Property="ToolTip" 
                            Value="{Binding RelativeSource={x:Static RelativeSource.Self}, 
                            Path=(Validation.Errors)[0].ErrorContent}" />
                                <Setter TargetName="HasErrors"  Property="Opacity" Value="1" />
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter TargetName="Border"  Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}" />
                                <Setter TargetName="Border"  Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="Validation.ErrorTemplate">
                <Setter.Value>
                    <ControlTemplate>
                        <Grid>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>


        <!--Custom button-->
        <Style x:Key="ButtonFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Border>
                            <Rectangle 
            Margin="2"
            StrokeThickness="1"
            Stroke="#60000000"
            StrokeDashArray="1 2"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style TargetType="Button">
            <Setter Property="Background" Value="#69810E"/>
            <Setter Property="FontSize" Value="11" />
            <Setter Property="Foreground" Value="white" />
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="SnapsToDevicePixels" Value="true"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
            <Setter Property="MinHeight" Value="23"/>
            <Setter Property="MinWidth" Value="23"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border 
          x:Name="Border"  
          CornerRadius="0" 
          BorderThickness="0"
          Background="#69810E"
          BorderBrush="#69810E">
                            <ContentPresenter 
            Margin="2"
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            RecognizesAccessKey="True"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsKeyboardFocused" Value="true">
                                <Setter TargetName="Border" Property="BorderBrush" Value="#69810E" />
                            </Trigger>
                            <Trigger Property="IsDefaulted" Value="true">
                                <Setter TargetName="Border" Property="BorderBrush" Value="#69810E" />
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="#799410" />
                            </Trigger>
                            <Trigger Property="IsPressed" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="#53650C" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="#53650C" />
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter TargetName="Border" Property="Background" Value="gray" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="gray" />
                                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <!-- TopLevelHeader -->
        <ControlTemplate x:Key="{x:Static MenuItem.TopLevelHeaderTemplateKey}"
                 TargetType="MenuItem">
            <Border Name="Border" >
                <Grid>
                    <ContentPresenter 
        Margin="6,3,6,3" 
        ContentSource="Header"
        RecognizesAccessKey="True" />
                    <Popup 
        Name="Popup"
        Placement="Bottom"
        IsOpen="{TemplateBinding IsSubmenuOpen}"
        AllowsTransparency="False" 
        Focusable="False"
        PopupAnimation="Fade">
                        <Border 
          Name="SubmenuBorder"
          SnapsToDevicePixels="True"
          Background="{StaticResource SolidBorderBrush}"
          BorderBrush="{StaticResource SolidBorderBrush}"
          BorderThickness="1" >
                            <StackPanel  
            IsItemsHost="True" 
            KeyboardNavigation.DirectionalNavigation="Cycle" />
                        </Border>
                    </Popup>
                </Grid>
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="IsSuspendingPopupAnimation" Value="true">
                    <Setter TargetName="Popup" Property="PopupAnimation" Value="None"/>
                </Trigger>
                <Trigger Property="IsHighlighted" Value="true">
                    <Setter TargetName="Border" Property="Background"
              Value="{StaticResource NormalBrush}"/>
                    <Setter Property="Foreground"
                            Value="white" />
                    <Setter TargetName="Border" Property="BorderBrush"
              Value="#69810E"/>
                </Trigger>
                <Trigger Property="IsHighlighted" Value="False">
                    <Setter TargetName="Border" Property="Background"
              Value="#69810E" />
                    <Setter Property="Foreground"  Value="white"/>
                </Trigger>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="Foreground" Value="#667777"/>
                    <Setter TargetName="Border" Property="Background" Value="#D4D4D4"/>
                </Trigger>
                <Trigger Property="IsPressed" Value="true">
                    <Setter TargetName="Border" Property="Background"
                            Value="#53650C"></Setter>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
        <!-- TopLevelItem -->

        <ControlTemplate 
  x:Key="{x:Static MenuItem.TopLevelItemTemplateKey}" 
  TargetType="MenuItem">
            <Border Name="Border" >
                <Grid>
                    <ContentPresenter 
        Margin="6,3,6,3" 
        ContentSource="Header"
        RecognizesAccessKey="True" />
                </Grid>
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="IsHighlighted" Value="true">
                    <Setter TargetName="Border" Property="Background"
              Value="{StaticResource NormalBrush}"/>
                    <Setter Property="Foreground" Value="white" />
                    <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource SolidBorderBrush}"/>
                </Trigger>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="Foreground" Value="#667777"/>
                    <Setter TargetName="Border" Property="Background" Value="#D4D4D4"/>
                </Trigger>
                <Trigger Property="IsPressed" Value="true">
                    <Setter TargetName="Border" Property="Background"
                            Value="#53650C"></Setter>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <!-- SubmenuItem -->

        <ControlTemplate 
  x:Key="{x:Static MenuItem.SubmenuItemTemplateKey}" 
  TargetType="MenuItem">
            <Border Name="Border" Background="#69810E">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" SharedSizeGroup="Icon"/>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="Auto" SharedSizeGroup="Shortcut"/>
                        <ColumnDefinition Width="13"/>
                    </Grid.ColumnDefinitions>
                    <ContentPresenter 
        Name="Icon"
        Margin="6,0,6,0"
        VerticalAlignment="Center"
        HorizontalAlignment="Center"
        ContentSource="Icon"/>
                    <Border 
        Name="Check"  
        Width="13" Height="13" 
        Visibility="Collapsed"
        Margin="6,0,6,0" 
        Background="{StaticResource NormalBrush}"
        BorderThickness="1"
        BorderBrush="#69810E">
                        <Path 
          Name="CheckMark"
          Width="7" Height="7" 
          Visibility="Hidden" 
          SnapsToDevicePixels="False" 
          Stroke="White"
          StrokeThickness="2"
          Data="M 0 0 L 7 7 M 0 7 L 7 0" />
                    </Border>
                    <ContentPresenter 
        Name="HeaderHost"
        Grid.Column="1"
        ContentSource="Header"
        RecognizesAccessKey="True"/>
                    <TextBlock x:Name="InputGestureText"
        Grid.Column="2"
     Text="{TemplateBinding InputGestureText}"        
        Margin="5,2,0,2"
        DockPanel.Dock="Right" />
                </Grid>
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="Icon" Value="{x:Null}">
                    <Setter TargetName="Icon" Property="Visibility" Value="Hidden"/>
                </Trigger>
                <Trigger Property="IsChecked" Value="true">
                    <Setter TargetName="CheckMark" Property="Visibility" Value="Visible"/>
                </Trigger>
                <Trigger Property="IsCheckable" Value="true">
                    <Setter TargetName="Check" Property="Visibility" Value="Visible"/>
                    <Setter TargetName="Icon" Property="Visibility" Value="Hidden"/>
                </Trigger>
                <Trigger Property="IsHighlighted" Value="true">
                    <Setter TargetName="Border" Property="Background"
              Value="#5C710D"/>
                    <Setter Property="Foreground"  Value="white"/>
                </Trigger>
                <Trigger Property="IsHighlighted" Value="False">
                    <Setter TargetName="Border" Property="Background"
              Value="#69810E" />
                    <Setter Property="Foreground"  Value="white"/>
                </Trigger>
                <Trigger Property="IsEnabled" Value="false">
                    <Setter Property="Foreground" Value="#667777"/>
                    <Setter TargetName="Border" Property="Background" Value="#D4D4D4"/>
                </Trigger>
                <Trigger Property="IsPressed" Value="true">
                    <Setter TargetName="Border" Property="Background"
                            Value="#53650C"></Setter>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <!-- SubmenuHeader -->

        <ControlTemplate 
  x:Key="{x:Static MenuItem.SubmenuHeaderTemplateKey}" 
  TargetType="MenuItem">
            <Border Name="Border" >
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" SharedSizeGroup="Icon"/>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="Auto" SharedSizeGroup="Shortcut"/>
                        <ColumnDefinition Width="13"/>
                    </Grid.ColumnDefinitions>
                    <ContentPresenter 
        Name="Icon"
        Margin="6,0,6,0"
        VerticalAlignment="Center"
        ContentSource="Icon"/>
                    <ContentPresenter 
        Name="HeaderHost"
        Grid.Column="1"
        ContentSource="Header"
        RecognizesAccessKey="True"/>
                    <TextBlock x:Name="InputGestureText"
        Grid.Column="2"
                      Background="#53650C"
                   Foreground="White"
        Text="{TemplateBinding InputGestureText}"
        Margin="5,2,2,2"
        DockPanel.Dock="Right"/>
                    <Path 
        Grid.Column="3"
        HorizontalAlignment="Center"
        VerticalAlignment="Center"
        Data="M 0 0 L 0 7 L 4 3.5 Z" 
        Fill="white" />
                    <Popup 
        Name="Popup"
        Placement="Right"
        HorizontalOffset="-4" 
        IsOpen="{TemplateBinding IsSubmenuOpen}"
        AllowsTransparency="False" 
        Focusable="False"
        PopupAnimation="Fade">
                        <Border 
          Name="SubmenuBorder"
          SnapsToDevicePixels="True"
          Background="#69810E"
          BorderBrush="white"
          BorderThickness="1" >
                            <StackPanel  
            IsItemsHost="True" 
            KeyboardNavigation.DirectionalNavigation="Cycle" />
                        </Border>
                    </Popup>
                </Grid>
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="Icon" Value="{x:Null}">
                    <Setter TargetName="Icon" Property="Visibility" Value="Collapsed"/>
                </Trigger>
                <Trigger Property="IsHighlighted" Value="true">
                    <Setter TargetName="Border" Property="Background"
              Value="{StaticResource NormalBrush}"/>
                    <Setter Property="Foreground" Value="white" />
                </Trigger>
                <Trigger Property="IsHighlighted" Value="false">
                    <Setter TargetName="Border" Property="Background"
              Value="#69810E"/>
                    <Setter Property="Foreground" Value="white" />
                </Trigger>
                <Trigger Property="IsEnabled" Value="false">
                    <Setter Property="Foreground" Value="#667777"/>
                    <Setter TargetName="Border" Property="Background" Value="#D4D4D4"/>
                </Trigger>
                <Trigger Property="IsPressed" Value="true">
                    <Setter TargetName="Border" Property="Background"
                            Value="#53650C"></Setter>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <!-- MenuItem Style -->

        <Style x:Key="{x:Type MenuItem}" TargetType="MenuItem">
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="FontWeight" Value="ExtraLight"/>
            <Setter Property="OverridesDefaultStyle" Value="True"/>
            <Style.Triggers>
                <Trigger Property="Role" Value="TopLevelHeader">
                    <Setter Property="Template"
              Value="{StaticResource {x:Static MenuItem.TopLevelHeaderTemplateKey}}"/>
                    <Setter Property="Grid.IsSharedSizeScope" Value="true"/>
                </Trigger>
                <Trigger Property="Role" Value="TopLevelItem">
                    <Setter Property="Template"
              Value="{StaticResource {x:Static MenuItem.TopLevelItemTemplateKey}}"/>
                </Trigger>
                <Trigger Property="Role" Value="SubmenuHeader">
                    <Setter Property="Template"
              Value="{StaticResource {x:Static MenuItem.SubmenuHeaderTemplateKey}}"/>
                </Trigger>
                <Trigger Property="Role" Value="SubmenuItem">
                    <Setter Property="Template"
              Value="{StaticResource {x:Static MenuItem.SubmenuItemTemplateKey}}"/>
                </Trigger>
                <Trigger Property="IsPressed" Value="true">
                    <Setter Property="Background"
                            Value="#53650C"></Setter>
                </Trigger>
            </Style.Triggers>
        </Style> 
        
        <!--Custom ScrollBar-->
        <Style x:Key="ScrollBarLineButton" TargetType="{x:Type RepeatButton}">
            <Setter Property="SnapsToDevicePixels" Value="True"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="Focusable" Value="false"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type RepeatButton}">
                        <Border 
          Name="Border"
          Margin="0,1,0,1" 
          CornerRadius="0" 
          Background="#F0F0F0"
          BorderBrush="#F0F0F0"
          BorderThickness="1">
                            <Path Name="Path"
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            Fill="#606060"
            Data="{Binding Path=Content,RelativeSource={RelativeSource TemplatedParent}}" >
                            </Path>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="#CDCDCD" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="#CDCDCD" />
                                <Setter TargetName="Path" Property="Fill" Value="black" />
                            </Trigger>
                            <Trigger Property="IsPressed" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="#606060" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="#606060" />
                                <Setter TargetName="Path" Property="Fill" Value="white" />
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}">
            <Setter Property="SnapsToDevicePixels" Value="True"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="IsTabStop" Value="false"/>
            <Setter Property="Focusable" Value="false"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type RepeatButton}">
                        <Border Background="Transparent" />
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
            <Setter Property="SnapsToDevicePixels" Value="True"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="IsTabStop" Value="false"/>
            <Setter Property="Focusable" Value="false"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Thumb}">
                        <Border Name="Border"
          CornerRadius="0" 
          Background="{TemplateBinding Background}"
          BorderBrush="{TemplateBinding BorderBrush}"
          BorderThickness="1" />
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="#DADADA" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="#DADADA" />
                            </Trigger>
                            <Trigger Property="IsDragging" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="#606060" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="#606060" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
            <Grid >
                <Grid.RowDefinitions>
                    <RowDefinition MaxHeight="18"/>
                    <RowDefinition Height="0.00001*"/>
                    <RowDefinition MaxHeight="18"/>
                </Grid.RowDefinitions>
                <Border
      Grid.RowSpan="3"
      CornerRadius="0" 
      Background="#F0F0F0" />
                <RepeatButton 
      Grid.Row="0"                           
      Style="{StaticResource ScrollBarLineButton}"
      Height="18"
      Command="ScrollBar.LineUpCommand"
      Content="M 0 4 L 8 4 L 4 0 Z" />
                <Track 
      Name="PART_Track"
      Grid.Row="1"
      IsDirectionReversed="true">
                    <Track.DecreaseRepeatButton>
                        <RepeatButton 
          Style="{StaticResource ScrollBarPageButton}"
          Command="ScrollBar.PageUpCommand" />
                    </Track.DecreaseRepeatButton>
                    <Track.Thumb>
                        <Thumb 
          Style="{StaticResource ScrollBarThumb}" 
          Margin="1,0,1,0"  
          Background="#CDCDCD"
          BorderBrush="#CDCDCD" />
                    </Track.Thumb>
                    <Track.IncreaseRepeatButton>
                        <RepeatButton 
          Style="{StaticResource ScrollBarPageButton}"
          Command="ScrollBar.PageDownCommand" />
                    </Track.IncreaseRepeatButton>
                </Track>
                <RepeatButton 
      Grid.Row="3" 
      Style="{StaticResource ScrollBarLineButton}"
      Height="18"
      Command="ScrollBar.LineDownCommand"
      Content="M 0 0 L 4 4 L 8 0 Z"/>
            </Grid>
        </ControlTemplate>

        <ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}">
            <Grid >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition MaxWidth="18"/>
                    <ColumnDefinition Width="0.00001*"/>
                    <ColumnDefinition MaxWidth="18"/>
                </Grid.ColumnDefinitions>
                <Border
      Grid.ColumnSpan="3"
      CornerRadius="0" 
      Background="#F0F0F0" />
                <RepeatButton 
      Grid.Column="0"                           
      Style="{StaticResource ScrollBarLineButton}"
      Width="18"
      Command="ScrollBar.LineLeftCommand"
      Content="M 4 0 L 4 8 L 0 4 Z" />
                <Track 
      Name="PART_Track"
      Grid.Column="1"
      IsDirectionReversed="False">
                    <Track.DecreaseRepeatButton>
                        <RepeatButton 
          Style="{StaticResource ScrollBarPageButton}"
          Command="ScrollBar.PageLeftCommand" />
                    </Track.DecreaseRepeatButton>
                    <Track.Thumb>
                        <Thumb 
          Style="{StaticResource ScrollBarThumb}" 
          Margin="0,1,0,1"  
          Background="#CDCDCD"
          BorderBrush="#CDCDCD" />
                    </Track.Thumb>
                    <Track.IncreaseRepeatButton>
                        <RepeatButton 
          Style="{StaticResource ScrollBarPageButton}"
          Command="ScrollBar.PageRightCommand" />
                    </Track.IncreaseRepeatButton>
                </Track>
                <RepeatButton 
      Grid.Column="3" 
      Style="{StaticResource ScrollBarLineButton}"
      Width="18"
      Command="ScrollBar.LineRightCommand"
      Content="M 0 0 L 4 4 L 0 8 Z"/>
            </Grid>
        </ControlTemplate>

        <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}">
            <Setter Property="SnapsToDevicePixels" Value="True"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Style.Triggers>
                <Trigger Property="Orientation" Value="Horizontal">
                    <Setter Property="Width" Value="Auto"/>
                    <Setter Property="Height" Value="18" />
                    <Setter Property="Template" Value="{StaticResource HorizontalScrollBar}" />
                </Trigger>
                <Trigger Property="Orientation" Value="Vertical">
                    <Setter Property="Width" Value="18"/>
                    <Setter Property="Height" Value="Auto" />
                    <Setter Property="Template" Value="{StaticResource VerticalScrollBar}" />
                </Trigger>
            </Style.Triggers>
        </Style>
        
        <!-- Custom Combobox item -->
        <Style x:Key="{x:Type ComboBoxItem}" TargetType="ComboBoxItem">
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="SnapsToDevicePixels" Value="true"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ComboBoxItem">
                        <Border 
          Name="Border"
          Padding="4"
          SnapsToDevicePixels="true">
                            <ContentPresenter />
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsHighlighted" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="#F3F3F3"/>
                                <Setter Property="Foreground" Value="Black"/>
                            </Trigger>
                            <Trigger Property="IsSelected" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="#69810E"/>
                                <Setter Property="Foreground" Value="white"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- Custom Combobox -->

        <ControlTemplate x:Key="ComboBoxToggleButton" TargetType="ToggleButton">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="20" />
                </Grid.ColumnDefinitions>
                <Border
      x:Name="Border" 
      Grid.ColumnSpan="2"
      CornerRadius="0"
      Background="#BABABA"
      BorderBrush="#BABABA"
      BorderThickness="1,2,1,2" />
                <Border Name="Separator"
      Grid.Column="0"
      CornerRadius="0,0,0,0" 
      Margin="1,2,1,2" 
      Background="{StaticResource WindowBackgroundBrush}" 
      BorderBrush="#BABABA"
      BorderThickness="0,0,1,0" />
                <Path 
      x:Name="Arrow"
      Grid.Column="1"     
      Fill="{StaticResource GlyphBrush}"
      HorizontalAlignment="Center"
      VerticalAlignment="Center"
      Data="M 0 0 L 4 4 L 8 0 Z"/>
            </Grid>
            <ControlTemplate.Triggers>
                <Trigger Property="ToggleButton.IsMouseOver" Value="true">
                    <Setter TargetName="Border" Property="Background" Value="#8F8F8F" />
                    <Setter TargetName="Border" Property="BorderBrush" Value="#8F8F8F" />
                    <Setter TargetName="Separator" Property="BorderBrush" Value="#8F8F8F" />
                </Trigger>
                <Trigger Property="ToggleButton.IsChecked" Value="true">
                    <Setter TargetName="Border" Property="Background" Value="#5C5C5C" />
                    <Setter TargetName="Border" Property="BorderBrush" Value="#5C5C5C" />
                    <Setter TargetName="Separator" Property="BorderBrush" Value="#5C5C5C" />
                </Trigger>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
                    <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}" />
                    <Setter TargetName="Separator" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}" />
                    <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                    <Setter TargetName="Arrow" Property="Fill" Value="{StaticResource DisabledForegroundBrush}" />
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <ControlTemplate x:Key="ComboBoxToggleButtonHasError" TargetType="ToggleButton">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="20" />
                </Grid.ColumnDefinitions>
                <Border
      x:Name="Border" 
      Grid.ColumnSpan="2"
      CornerRadius="0"
      Background="Red"
      BorderBrush="Red"
      BorderThickness="1,2,1,2" />
                <Border Name="Separator"
      Grid.Column="0"
      CornerRadius="0,0,0,0" 
      Margin="1,2,1,2" 
      Background="{StaticResource WindowBackgroundBrush}" 
      BorderBrush="Red"
      BorderThickness="0,0,1,0" />
                <Path 
      x:Name="Arrow"
      Grid.Column="1"     
      Fill="{StaticResource GlyphBrush}"
      HorizontalAlignment="Center"
      VerticalAlignment="Center"
      Data="M 0 0 L 4 4 L 8 0 Z"/>
            </Grid>
            <ControlTemplate.Triggers>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
                    <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}" />
                    <Setter TargetName="Separator" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}" />
                    <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                    <Setter TargetName="Arrow" Property="Fill" Value="{StaticResource DisabledForegroundBrush}" />
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <ControlTemplate x:Key="ComboBoxTextBox" TargetType="TextBox">
            <Border x:Name="PART_ContentHost" Focusable="False" Background="{TemplateBinding Background}" >
            </Border>
        </ControlTemplate>

        <Style x:Key="{x:Type ComboBox}" TargetType="ComboBox">
            <Setter Property="SnapsToDevicePixels" Value="true"/>
            <Setter Property="Validation.ErrorTemplate">
                <Setter.Value>
                    <ControlTemplate>
                        <Grid>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
            <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
            <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
            <Setter Property="MinWidth" Value="20"/>
            <Setter Property="MinHeight" Value="20"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ComboBox">
                        <Grid>
                            <ToggleButton 
            Name="ToggleButton" 
            Template="{StaticResource ComboBoxToggleButton}" 
            Grid.Column="2" 
            Focusable="false"
            IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
            ClickMode="Press">
                            </ToggleButton>
                            <ContentPresenter
            Name="ContentSite"
            IsHitTestVisible="False" 
            Content="{TemplateBinding SelectionBoxItem}"
            ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
            ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
            Margin="3,3,23,3"
            VerticalAlignment="Center"
            HorizontalAlignment="Left" />
                            <TextBox x:Name="PART_EditableTextBox"
            Style="{x:Null}" 
            Template="{StaticResource ComboBoxTextBox}" 
            HorizontalAlignment="Left" 
            VerticalAlignment="Center" 
            Margin="3,3,23,3"
            Focusable="True" 
            Background="Transparent"
            Visibility="Hidden"
            IsReadOnly="{TemplateBinding IsReadOnly}"/>
                            <Popup 
            Name="Popup"
            Placement="Bottom"
            IsOpen="{TemplateBinding IsDropDownOpen}"
            AllowsTransparency="True" 
            Focusable="False"
            PopupAnimation="Slide">
                                <Grid 
              Name="DropDown"
              SnapsToDevicePixels="True"                
              MinWidth="{TemplateBinding ActualWidth}"
              MaxHeight="{TemplateBinding MaxDropDownHeight}">
                                    <Border 
                x:Name="DropDownBorder"
                Background="{StaticResource WindowBackgroundBrush}"
                BorderThickness="1"
                BorderBrush="#5C5C5C"/>
                                    <ScrollViewer Margin="1,0,1,1" SnapsToDevicePixels="True">
                                        <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
                                    </ScrollViewer>
                                </Grid>
                            </Popup>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="HasItems" Value="false">
                                <Setter TargetName="DropDownBorder" Property="MinHeight" Value="95"/>
                            </Trigger>
                            <Trigger Property="Validation.HasError" Value="true">
                                <Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)[0].ErrorContent}" />
                                <Setter TargetName="ToggleButton" Property="Template" Value="{StaticResource ComboBoxToggleButtonHasError}"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                            </Trigger>
                            <Trigger Property="IsGrouping" Value="true">
                                <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                            </Trigger>
                            
                            <Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="true">
                                <Setter TargetName="DropDownBorder" Property="CornerRadius" Value="0"/>
                                <Setter TargetName="DropDownBorder" Property="Margin" Value="0,-1,0,0"/>
                            </Trigger>
                            <Trigger Property="IsEditable"
               Value="true">
                                <Setter Property="IsTabStop" Value="false"/>
                                <Setter TargetName="PART_EditableTextBox" Property="Visibility"    Value="Visible"/>
                                <Setter TargetName="ContentSite" Property="Visibility" Value="Hidden"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>

            <Style.Triggers>
            </Style.Triggers>
        </Style>
        
        <!-- Custom ValidationComboBox-->
        <Style TargetType="{x:Type CustomControls:ValidationComboBox}"
       BasedOn="{StaticResource {x:Type ComboBox}}">
        </Style>
    
        <!-- Custom Label -->
        <Style x:Key="{x:Type Label}" TargetType="Label">
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="FontWeight" Value="Normal" />
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Top"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Label">
                        <Border>
                            <ContentPresenter 
            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
            RecognizesAccessKey="True"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground"
                    Value="{StaticResource DisabledForegroundBrush}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- Custom Groupbox Printable -->

        <Style x:Key="PrintableGroupBox" TargetType="GroupBox">
            <Setter Property="FontFamily" Value="Segoe UI"></Setter>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="GroupBox">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Border 
            Grid.Row="0" 
            Background="White"
            BorderBrush="#5C5C5C"
            BorderThickness="2,4,2,2" 
            CornerRadius="0,0,0,0" >
                                <ContentPresenter 
              Margin="4" 
              ContentSource="Header" 
              RecognizesAccessKey="True" />
                            </Border>
                            <Border 
            Grid.Row="1"
            Background="White"
            BorderBrush="#5C5C5C"
            BorderThickness="2,1,2,4" 
            CornerRadius="0,0,0,0" >
                                <ContentPresenter 
              Margin="4" />
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="HeaderTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <TextBlock Text="{Binding}" FontSize="20" FontWeight="Normal"/>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- Custom Groupbox -->

        <Style x:Key="{x:Type GroupBox}" TargetType="GroupBox">
            <Setter Property="FontFamily" Value="Segoe UI"></Setter>
                <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="GroupBox">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Border 
            Grid.Row="0" 
            Background="#CDF2A4"
            BorderBrush="#5C5C5C"
            BorderThickness="2,4,2,2" 
            CornerRadius="0,0,0,0" >
                                <ContentPresenter 
              Margin="4" 
              ContentSource="Header" 
              RecognizesAccessKey="True" />
                            </Border>
                            <Border 
            Grid.Row="1"
            Background="#DDF5A5"
            BorderBrush="#5C5C5C"
            BorderThickness="2,1,2,4" 
            CornerRadius="0,0,0,0" >
                                <ContentPresenter 
              Margin="4" />
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="HeaderTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <TextBlock Text="{Binding}" FontSize="20" FontWeight="Normal"/>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        
        <!-- Custom GroupBox Default-->
        <Style x:Key="DefGroupBoxStyle" TargetType="GroupBox" BasedOn="{StaticResource {x:Type GroupBox}}" >
        </Style>
            
        <!-- Custom scrollviewer -->
        <Style TargetType="{x:Type ScrollViewer}">
            <Setter Property="OverridesDefaultStyle" Value="True"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ScrollViewer}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <ScrollContentPresenter Grid.Column="1"/>

                            <ScrollBar Name="PART_VerticalScrollBar"
            Value="{TemplateBinding VerticalOffset}"
            Maximum="{TemplateBinding ScrollableHeight}"
            ViewportSize="{TemplateBinding ViewportHeight}"
            Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"/>
                            <ScrollBar Name="PART_HorizontalScrollBar"
            Orientation="Horizontal"
            Grid.Row="1"
            Grid.Column="1"
            Value="{TemplateBinding HorizontalOffset}"
            Maximum="{TemplateBinding ScrollableWidth}"
            ViewportSize="{TemplateBinding ViewportWidth}"
            Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"/>

                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        
        <!-- Custom ListView and ListViewItems -->

        <DataTemplate x:Key="InformerItemTemplate">
            <Border BorderThickness="0,0,0,0" BorderBrush="#629923">
                <Grid Height="80">
                <TextBlock Margin="10,0,0,0" Text="{Binding Informer}" VerticalAlignment="Center"  ToolTip="Nombre del Denunciante"/>
                    <TextBlock FontSize="10" Margin="10,0,0,10" Text="{Binding Path=InformerCi, StringFormat='Ci: {0}'}" VerticalAlignment="Bottom" ToolTip="Ci del Denunciante" />
                </Grid>
            </Border>
        </DataTemplate>

        <DataTemplate x:Key="DetailsItemTemplate">
            <Border BorderThickness="0,0,0,0" BorderBrush="#629923">
                <Grid Height="80">
                    <TextBlock Width="140" TextWrapping="Wrap" Margin="10,0,0,0" Text="{Binding IncidentNature}" VerticalAlignment="Center"  ToolTip="Tipo de agresion"/>
                    <TextBlock FontSize="10" Margin="10,0,0,15" Text="{Binding Path=NumberOfCase, StringFormat='Numero de Caso: {0}'}"  VerticalAlignment="Bottom" ToolTip="Número de caso" />
                    <TextBlock FontSize="10" Margin="10,0,0,0" Text="{Binding Path=DateOfCase, StringFormat='Fecha del Caso: {0}'}"  VerticalAlignment="Bottom" ToolTip="Fecha del caso" />
                </Grid>
            </Border>
        </DataTemplate>

        <DataTemplate x:Key="VictimItemTemplate">
            <Border BorderThickness="0,0,0,0" BorderBrush="#629923">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="80" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Image Source="{Binding VictimImage}" Width="80" Height="80" Grid.Column="0" HorizontalAlignment="Center" />
                    <TextBlock Margin="10,0,0,0" Text="{Binding Victim}" VerticalAlignment="Center" Grid.Column="1" ToolTip="Nombre de la Victima" />
                    <TextBlock FontSize="10" Margin="10,0,0,10" Text="{Binding Path=VictimCi, StringFormat='Ci: {0}'}" VerticalAlignment="Bottom" Grid.Column="1" ToolTip="Ci de la Victima" />
                </Grid>
            </Border>
        </DataTemplate>

        <DataTemplate x:Key="AggressorItemTemplate">
            <Border BorderThickness="0,0,0,0" BorderBrush="#629923">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="80" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Image Source="{Binding AggressorImage}" Width="80" Height="80" Grid.Column="0" HorizontalAlignment="Center" />
                    <TextBlock Margin="10,0,0,0" Text="{Binding Aggressor}" VerticalAlignment="Center" Grid.Column="1" ToolTip="Nombre completo"/>
                    <TextBlock FontSize="10" Margin="10,0,0,10" Text="{Binding Path=AggressorCi, StringFormat='Ci: {0}'}" VerticalAlignment="Bottom" Grid.Column="1" ToolTip="Ci del Agresor" />
                </Grid>
            </Border>
        </DataTemplate>
        <Style x:Key="ListViewItemContainerStyle" TargetType="{x:Type ListViewItem}">
            <Setter Property="Background" Value="#ffffff" />
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="FontWeight" Value="Light"/>
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="HorizontalContentAlignment" Value="Left" />
            <Setter Property="Height" Value="100"/>
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="Foreground" Value="Black" />
            <Setter Property="Margin" Value="0,0,0,0" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ListViewItem}">
                        <Border x:Name="Bd" Background="{TemplateBinding Background}" SnapsToDevicePixels="true" BorderThickness="0,0,0,1" BorderBrush="#BABABA">
                            <GridViewRowPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsSelected"  Value="true">
                                <Setter TargetName="Bd" Property="BorderBrush" Value="#5C5C5C" />
                                <Setter Property="Background" TargetName="Bd" Value="#69810E"/>
                                <Setter Property="Foreground" Value="White"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="Bd" Property="Background" Value="#F3F3F3" />
                                <Setter TargetName="Bd" Property="BorderBrush" Value="#8F8F8F"/>
                            </Trigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsSelected" Value="true" />
                                    <Condition Property="Selector.IsSelectionActive" Value="True" />
                                </MultiTrigger.Conditions>
                                <Setter Property="Background" TargetName="Bd" Value="#69810E">
                                </Setter>
                                <Setter Property="BorderBrush" TargetName="Bd" Value="#5C5C5C"/>
                                <Setter Property="Foreground" Value="White"/>
                            </MultiTrigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!--For PsicologistReports-->

        <DataTemplate x:Key="CiPatientItemTemplate">
            <Border BorderThickness="0,0,0,0" BorderBrush="#629923">
                <Grid Height="40">
                    <TextBlock Margin="10,0,0,0" Text="{Binding CiPatient}" VerticalAlignment="Center" ToolTip="Ci del Empleado" />
                </Grid>
            </Border>
        </DataTemplate>

        <DataTemplate x:Key="NamePatientItemTemplate">
            <Border BorderThickness="0,0,0,0" BorderBrush="#629923">
                <Grid Height="40">
                    <TextBlock Margin="10,0,0,0" Text="{Binding NamePatient}" VerticalAlignment="Center" ToolTip="Ci del Empleado" />
                </Grid>
            </Border>
        </DataTemplate>

        <DataTemplate x:Key="CiPsicologistItemTemplate">
            <Border BorderThickness="0,0,0,0" BorderBrush="#629923">
                <Grid Height="40">
                    <TextBlock Margin="10,0,0,0" Text="{Binding CiPsicologist}" VerticalAlignment="Center" ToolTip="Ci del Empleado" />
                </Grid>
            </Border>
        </DataTemplate>

        <DataTemplate x:Key="NamePsicologistItemTemplate">
            <Border BorderThickness="0,0,0,0" BorderBrush="#629923">
                <Grid Height="40">
                    <TextBlock Margin="10,0,0,0" Text="{Binding NamePsicologist}" VerticalAlignment="Center" ToolTip="Rango del Empleado" />
                </Grid>
            </Border>
        </DataTemplate>

        <DataTemplate x:Key="DateItemTemplate">
            <Border BorderThickness="0,0,0,0" BorderBrush="#629923">
                <Grid Height="40">
                    <TextBlock Margin="10,0,0,0" Text="{Binding Date}" VerticalAlignment="Center" ToolTip="Cargo del Empleado" />
                </Grid>
            </Border>
        </DataTemplate>

        <DataTemplate x:Key="IdItemTemplate">
            <Border BorderThickness="0,0,0,0" BorderBrush="#629923">
                <Grid Height="40">
                    <TextBlock Margin="10,0,0,0" Text="{Binding Id}" VerticalAlignment="Center" ToolTip="Cargo del Empleado" />
                </Grid>
            </Border>
        </DataTemplate>

        <!--For Employees-->
        <DataTemplate x:Key="CiEmployeeItemTemplate">
            <Border BorderThickness="0,0,0,0" BorderBrush="#629923">
                <Grid Height="40">
                    <TextBlock Margin="10,0,0,0" Text="{Binding CI}" VerticalAlignment="Center" ToolTip="Ci del Empleado" />
                </Grid>
            </Border>
        </DataTemplate>

        <DataTemplate x:Key="NameEmployeeItemTemplate">
            <Border BorderThickness="0,0,0,0" BorderBrush="#629923">
                <Grid Height="40">
                    <TextBlock Margin="10,0,0,0" Text="{Binding Name}" VerticalAlignment="Center" ToolTip="Ci del Empleado" />
                </Grid>
            </Border>
        </DataTemplate>

        <DataTemplate x:Key="RankEmployeeItemTemplate">
            <Border BorderThickness="0,0,0,0" BorderBrush="#629923">
                <Grid Height="40">
                    <TextBlock Margin="10,0,0,0" Text="{Binding Rank}" VerticalAlignment="Center" ToolTip="Rango del Empleado" />
                </Grid>
            </Border>
        </DataTemplate>

        <DataTemplate x:Key="WorkingRoleItemTemplate">
            <Border BorderThickness="0,0,0,0" BorderBrush="#629923">
                <Grid Height="40">
                    <TextBlock Margin="10,0,0,0" Text="{Binding WorkingRole}" VerticalAlignment="Center" ToolTip="Cargo del Empleado" />
                </Grid>
            </Border>
        </DataTemplate>
                      
        <Style x:Key="ListViewEmployeeContainerStyle" TargetType="{x:Type ListViewItem}">
            <Setter Property="Background" Value="#ffffff" />
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="FontWeight" Value="Light"/>
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="HorizontalContentAlignment" Value="Left" />
            <Setter Property="Height" Value="50"/>
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="Foreground" Value="Black" />
            <Setter Property="Margin" Value="0,0,0,0" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ListViewItem}">
                        <Border x:Name="Bd" Background="{TemplateBinding Background}" SnapsToDevicePixels="true" BorderThickness="0,0,0,1" BorderBrush="#BABABA">
                            <GridViewRowPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsSelected"  Value="true">
                                <Setter TargetName="Bd" Property="BorderBrush" Value="#5C5C5C" />
                                <Setter Property="Background" TargetName="Bd" Value="#69810E"/>
                                <Setter Property="Foreground" Value="White"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="Bd" Property="Background" Value="#F3F3F3" />
                                <Setter TargetName="Bd" Property="BorderBrush" Value="#8F8F8F"/>
                            </Trigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsSelected" Value="true" />
                                    <Condition Property="Selector.IsSelectionActive" Value="True" />
                                </MultiTrigger.Conditions>
                                <Setter Property="Background" TargetName="Bd" Value="#69810E">
                                </Setter>
                                <Setter Property="BorderBrush" TargetName="Bd" Value="#5C5C5C"/>
                                <Setter Property="Foreground" Value="White"/>
                            </MultiTrigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!--For search-->
        <DataTemplate x:Key="InformerSearchTemplate">
            <Border BorderThickness="0,0,0,0" BorderBrush="#629923">
                <Grid Height="40">
                    <TextBlock Margin="10,0,0,0" Text="{Binding Informer}" VerticalAlignment="Top"  ToolTip="Nombre del Denunciante"/>
                    <TextBlock FontSize="10" Margin="10,0,0,6" Text="{Binding Path=InformerCi, StringFormat='Ci: {0}'}" VerticalAlignment="Bottom" ToolTip="Ci del Denunciante" />
                </Grid>
            </Border>
        </DataTemplate>

        <DataTemplate x:Key="DetailsSearchTemplate">
            <Border BorderThickness="0,0,0,0" BorderBrush="#629923">
                <Grid Height="40">
                    <TextBlock Width="140" TextWrapping="Wrap" Margin="10,0,0,0" Text="{Binding IncidentNature}" VerticalAlignment="Top"  ToolTip="Tipo de agresion"/>
                    <TextBlock FontSize="10" Margin="10,0,0,12" Text="{Binding Path=NumberOfCase, StringFormat='Numero de Caso: {0}'}"  VerticalAlignment="Bottom" ToolTip="Número de caso" />
                    <TextBlock FontSize="10" Margin="10,0,0,0" Text="{Binding Path=DateOfCase, StringFormat='Fecha del Caso: {0}'}"  VerticalAlignment="Bottom" ToolTip="Fecha del caso" />
                </Grid>
            </Border>
        </DataTemplate>

        <DataTemplate x:Key="VictimSearchTemplate">
            <Border BorderThickness="0,0,0,0" BorderBrush="#629923">
                <Grid Height="40">
                    <TextBlock Margin="10,0,0,0" Text="{Binding Victim}" VerticalAlignment="Top"  ToolTip="Nombre de la Victima" />
                    <TextBlock FontSize="10" Margin="10,0,0,6" Text="{Binding Path=VictimCi, StringFormat='Ci: {0}'}" VerticalAlignment="Bottom" ToolTip="Ci de la Victima" />
                </Grid>
            </Border>
        </DataTemplate>

        <DataTemplate x:Key="AggressorSearchTemplate">
            <Border BorderThickness="0,0,0,0" BorderBrush="#629923">
                <Grid Height="40">
                    <TextBlock Margin="10,0,0,0" Text="{Binding Aggressor}" VerticalAlignment="Top" ToolTip="Nombre completo"/>
                    <TextBlock FontSize="10" Margin="10,0,0,6" Text="{Binding Path=AggressorCi, StringFormat='Ci: {0}'}" VerticalAlignment="Bottom"  ToolTip="Ci del Agresor" />
                </Grid>
            </Border>
        </DataTemplate>

        <Style x:Key="ListViewSearchContainerStyle" TargetType="{x:Type ListViewItem}">
            <Setter Property="Background" Value="#ffffff" />
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="FontWeight" Value="Light"/>
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="HorizontalContentAlignment" Value="Left" />
            <Setter Property="Height" Value="50"/>
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="Foreground" Value="Black" />
            <Setter Property="Margin" Value="0,0,0,0" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ListViewItem}">
                        <Border x:Name="Bd" Background="{TemplateBinding Background}" SnapsToDevicePixels="true" BorderThickness="0,0,0,1" BorderBrush="#BABABA">
                            <GridViewRowPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsSelected"  Value="true">
                                <Setter TargetName="Bd" Property="BorderBrush" Value="#5C5C5C" />
                                <Setter Property="Background" TargetName="Bd" Value="#69810E"/>
                                <Setter Property="Foreground" Value="White"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="Bd" Property="Background" Value="#F3F3F3" />
                                <Setter TargetName="Bd" Property="BorderBrush" Value="#8F8F8F"/>
                            </Trigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsSelected" Value="true" />
                                    <Condition Property="Selector.IsSelectionActive" Value="True" />
                                </MultiTrigger.Conditions>
                                <Setter Property="Background" TargetName="Bd" Value="#69810E">
                                </Setter>
                                <Setter Property="BorderBrush" TargetName="Bd" Value="#5C5C5C"/>
                                <Setter Property="Foreground" Value="White"/>
                            </MultiTrigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <LinearGradientBrush x:Key="BackgroundBrush" StartPoint="0,0" EndPoint="0,1">
            <LinearGradientBrush.GradientStops>
                <GradientStopCollection>
                    <GradientStop Color="#799410" Offset="0"/>
                    <GradientStop Color="#245500" Offset="1"/>
                </GradientStopCollection>
            </LinearGradientBrush.GradientStops>
        </LinearGradientBrush>

        <LinearGradientBrush x:Key="HighlightBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
            <LinearGradientBrush.GradientStops>
                <GradientStopCollection>
                    <GradientStop Color="#93B313" Offset="0"/>
                    <GradientStop Color="#368000" Offset="1"/>
                </GradientStopCollection>
            </LinearGradientBrush.GradientStops>
        </LinearGradientBrush>

        <LinearGradientBrush x:Key="BorderBrush" StartPoint="0,0" EndPoint="0,1">
            <LinearGradientBrush.GradientStops>
                <GradientStopCollection>
                    <GradientStop Color="#799410" Offset="0"/>
                    <GradientStop Color="#245500" Offset="1"/>
                </GradientStopCollection>
            </LinearGradientBrush.GradientStops>
        </LinearGradientBrush>

        <LinearGradientBrush x:Key="PressedBorderBrush" StartPoint="0,0" EndPoint="0,1">
            <LinearGradientBrush.GradientStops>
                <GradientStopCollection>
                    <GradientStop Color="#69810E" Offset="0"/>
                    <GradientStop Color="#214F00" Offset="1"/>
                </GradientStopCollection>
            </LinearGradientBrush.GradientStops>
        </LinearGradientBrush>

        <Style x:Key="GridViewColumnHeaderGripper" TargetType="Thumb">
            <Setter Property="Width" Value="14"/>
            <Setter Property="Background" Value="BLACK"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Thumb}">
                        <Border Padding="{TemplateBinding Padding}" Background="Transparent">
                            <Rectangle HorizontalAlignment="Center" Width="1" Fill="{TemplateBinding Background}"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="{x:Type GridViewColumnHeader}" TargetType="GridViewColumnHeader">
            <Setter Property="FontFamily" Value="Segoe UI"></Setter>
            <Setter Property="FontWeight" Value="Light"/>
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Foreground" Value="#FFFFFF" />
            <Setter Property="Padding" Value="8"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="GridViewColumnHeader">
                        <Grid>
                            <Border Name="HeaderBorder" Padding="{TemplateBinding Padding}" BorderThickness="0,0,0,0" BorderBrush="{StaticResource BorderBrush}" Background="{StaticResource BackgroundBrush}">
                                <ContentPresenter Name="HeaderContent" Margin="0,0,0,0" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                            </Border>
                            <Thumb x:Name="PART_HeaderGripper" HorizontalAlignment="Right" Margin="0,0,-8,0" Style="{StaticResource GridViewColumnHeaderGripper}"/>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter TargetName="HeaderBorder" Property="Background" Value="{StaticResource HighlightBackgroundBrush}"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="true">
                                <Setter TargetName="HeaderBorder" Property="Background" Value="{StaticResource PressedBorderBrush}"/>
                                <Setter TargetName="HeaderContent" Property="Margin" Value="0,0,0,0"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="Role" Value="Floating">
                    <Setter Property="Opacity" Value="0.7"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="GridViewColumnHeader">
                                <Canvas Name="PART_FloatingHeaderCanvas">
                                    <Rectangle Fill="#60000000" Width="{TemplateBinding ActualWidth}" Height="{TemplateBinding ActualHeight}"/>
                                </Canvas>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Trigger>
                <Trigger Property="Role" Value="Padding">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="GridViewColumnHeader">
                                <Border Name="HeaderBorder" BorderThickness="0,0,0,0" BorderBrush="{StaticResource BorderBrush}" Background="{StaticResource BackgroundBrush}"/>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Trigger>
            </Style.Triggers>
        </Style>

        <Style x:Key="{x:Static GridView.GridViewScrollViewerStyleKey}" TargetType="ScrollViewer">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ScrollViewer">
                        <Grid Background="{TemplateBinding Background}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <DockPanel Margin="{TemplateBinding Padding}">
                                <ScrollViewer DockPanel.Dock="Top" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" Focusable="false">
                                    <GridViewHeaderRowPresenter Margin="0,0,0,0" Columns="{Binding Path=TemplatedParent.View.Columns,
                                            RelativeSource={RelativeSource TemplatedParent}}" ColumnHeaderContainerStyle="{Binding Path=TemplatedParent.View.ColumnHeaderContainerStyle, RelativeSource={RelativeSource TemplatedParent}}" 
                                            ColumnHeaderTemplate="{Binding Path=TemplatedParent.View.ColumnHeaderTemplate,RelativeSource={RelativeSource TemplatedParent}}" 
                                            ColumnHeaderTemplateSelector="{Binding Path=TemplatedParent.View.ColumnHeaderTemplateSelector, RelativeSource={RelativeSource TemplatedParent}}" 
                                            AllowsColumnReorder="{Binding Path=TemplatedParent.View.AllowsColumnReorder, RelativeSource={RelativeSource TemplatedParent}}"
                                            ColumnHeaderContextMenu="{Binding Path=TemplatedParent.View.ColumnHeaderContextMenu, RelativeSource={RelativeSource TemplatedParent}}" 
                                            ColumnHeaderToolTip="{Binding Path=TemplatedParent.View.ColumnHeaderToolTip, RelativeSource={RelativeSource TemplatedParent}}" 
                                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                                </ScrollViewer>
                                <ScrollContentPresenter Name="PART_ScrollContentPresenter"
                                            KeyboardNavigation.DirectionalNavigation="Local"
                                            CanContentScroll="True" CanHorizontallyScroll="False" 
                                            CanVerticallyScroll="False"/>
                            </DockPanel>
                            <ScrollBar Name="PART_HorizontalScrollBar" Orientation="Horizontal" Grid.Row="1" Maximum="{TemplateBinding ScrollableWidth}" ViewportSize="{TemplateBinding ViewportWidth}" Value="{TemplateBinding HorizontalOffset}" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"/>
                            <ScrollBar Name="PART_VerticalScrollBar" Grid.Column="1" Maximum="{TemplateBinding ScrollableHeight}" ViewportSize="{TemplateBinding ViewportHeight}" Value="{TemplateBinding VerticalOffset}" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="{x:Type ListView}" TargetType="ListView">
            <Setter Property="SnapsToDevicePixels" Value="true"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
            <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
            <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ListView">
                        <Border Name="Border" BorderThickness="1" BorderBrush="#BABABA" Background="White">
                            <ScrollViewer Style="{DynamicResource {x:Static GridView.GridViewScrollViewerStyleKey}}">
                                <ItemsPresenter />
                            </ScrollViewer>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsGrouping" Value="true">
                                <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter TargetName="Border" Property="Background" Value="#BBBBBB"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Application.Resources>
</Application>
